package com.mbti.youmore.service;

import com.mbti.youmore.common.exception.UserNotExistsException;
import com.mbti.youmore.entity.Chat;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
* @author Guqier
* @description 针对表【t_chat】的数据库操作Service
* @createDate 2024-05-08 20:30:45
*/
public interface ChatService extends IService<Chat> {

    @Transactional
    boolean sendMsg(Chat Chat) throws UserNotExistsException;

    @Transactional
    List<Chat> getMsg(Integer userId, Integer targetUserId) throws UserNotExistsException;

    List<Map<String, Object>> getChatList(Integer userId);

    @Transactional
    boolean setIsRead(Integer msgId);

    @Transactional
    int deleteChat(Integer userId, Integer targetUserId) throws UserNotExistsException;

    int deleteChatMsg(Integer msgId);

    int getNotReadCount(Integer userId);
}
